import request from '@/utils/request'

const api = {
  query: '/v1/auth/attendance/all',
  downloadExcel:'/v1/auth/attendance/export'
}


export const getList = e => {

  return request({
    url: api.query,
    method: 'get',
    params: e
  })
}

export const exportExcel= e=>{
  let dateRange = e.dateRange
  e.startDate = dateRange ? dateRange[0].format('YYYY-MM-DD') : ""
  e.endDate = dateRange ? dateRange[1].format('YYYY-MM-DD') : ""
  return request({
    url: api.downloadExcel,
    responseType: 'blob',
    method: 'get',
    params: e
  })
}